package org.asociacion.backend.persistence.entities;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.validation.constraints.Min;

@Entity
@Table(name = "tbl_index_image_properties", catalog = "asociacion")
public class TblIndexImageProperties {

	@Id
	@Column
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@Column(nullable=false, length=50, unique=true)
	private String folder;
	
	@Column(nullable=false)
	@Min(1)
	private Integer length;
	
	@Column(nullable=false)
	@Min(1)
	private Integer width;
	
	@OneToMany(mappedBy="tblIndexImageProperties")
	@OrderBy("name asc")
	private Set<TblIndexImage> setTblIndexImage;
	
	{
		setTblIndexImage = new HashSet<TblIndexImage>();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Set<TblIndexImage> getSetTblIndexImage() {
		return setTblIndexImage;
	}

	public void setSetTblIndexImage(Set<TblIndexImage> setTblIndexImage) {
		this.setTblIndexImage = setTblIndexImage;
	}

	public String getFolder() {
		return folder;
	}

	public void setFolder(String folder) {
		this.folder = folder;
	}

	public Integer getLength() {
		return length;
	}

	public void setLength(Integer length) {
		this.length = length;
	}

	public Integer getWidth() {
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

}
